package hot.job.test.job;

import hot.job.core.annotation.HotJob;
import hot.job.core.job.StoppableJob;
import lombok.SneakyThrows;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * my test hot job1
 *
 * @author gaowenhao
 * @since 2022/7/11 20:08
 */
@HotJob(name = "myJob1")
public class MyJob1 extends StoppableJob {

    @SneakyThrows
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        while(!super.stopped()){
            System.out.println("my job1 is running.....");
            Thread.sleep(1500L);
        }
        System.out.println("my job1 is stopped.");
    }

}
